<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'资源添加', styles:'bootstrap,font-awesome,animate,style,dtvalidate,layer,chosen,layui'}){%>
    <style type="text/css">
        body{padding-top:10px;}
    </style>
    <%}%>
</head>
<body>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="col-sm-offset-1 col-sm-10" style="margin-left: -10px;width: 100%;">
                <button type="button" class="return-btn btn btn-w-m btn-primary">返回</button>
                <div style="border-color: #e7eaec;border-image: none;border-style: solid solid none;border-width: 4px 0px;padding-bottom: 15px;margin-top: 10px;" ></div>
            </div>
        </div>
    </div>
</div>
<!-- START 内容部分 -->
<div class="container" >
    <form class="form-horizontal" id="info-form" method="post" autocomplete="off" style="margin: auto">
        <div class="form-group">
            <label class="control-label col-sm-2">柜号</label>
            <div class="col-sm-6">
                    <input id="createPlanNo" name="createPlanNo" class="form-control" />
            </div>
        </div>
        <input type="hidden"  readonly="readonly" id="operateName" value="${user.userRealname}" name="operateName"  class="form-control" />
        <div class="form-group">
            <label class="control-label col-sm-2">供应商</label>
            <div class="col-sm-6">
                    <select  id="supplierId"  xm-select="supplierId" xm-select-radio xm-select-search>
                        <%for(var dict in supplier){%>
                        <option  value="${dict.supplierName}">${dict.supplierName}</option>
                        <%}%>
                    </select>
                    <input type="hidden" id="supplierName" name="supplierName">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label text-right">异常原因:</label>
            <div class="col-sm-6">
                <select  name="unusualReason" id="unusualReason" class="form-control">
                    <option value="">全部分类</option>
                    <%for(var dict in unusual){%>
                    <option value="${dict.detailName}"  >${dict.detailName}</option>
                    <%}%>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label text-right">费用</label>
            <div class="col-sm-6 form-inline">
                <select class="form-control" id="unusualMoneyType" name="unusualMoneyType">
                    <option value="">币种</option>
                    <option value="人民币">人民币</option>
                    <option value="美金">美金</option>
                    <option value="加元">加元</option>
                    <option value="欧元">欧元</option>
                    <option value="英镑">英镑</option>
                    <option value="日元">日元</option>
                    <option value="埃及镑">埃及镑</option>
                </select>
                <input type="text"  id="unusualMoneyOriginal" name="unusualMoneyOriginal"  class="form-control" />
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label text-right">实际装柜时间:</label>
            <div class="col-sm-6">
                <input id="unusualTime" name="unusualTime"  class="form-control" />
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label text-right">备注</label>
            <div class="col-sm-6">
                <textarea id="operateRemark" name="operateRemark"  class="form-control" rows="3"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="save-btn btn btn-primary">
                    <i class="fa fa-save"></i> 保存
                </button>
                <button type="button" class="return-btn btn btn-warning">
                    <i class="fa fa-save"></i> 返回
                </button>
            </div>
        </div>
    </form>
</div>
<!-- END 内容部分 -->

<!-- START 公共脚本 -->
<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,dtvalidate,dtvalidate-lang-zh_cn,laydate,layer,chosen,chosen-demo'}){}%>
<!-- END 公共脚本 -->
<script>

    laydate.render({
        elem: '#unusualTime' //指定元素
        ,trigger: 'click'
    });


   //提交表单
   $('.save-btn').on('click',function(){
       var supplierId=formSelects.value('supplierId', 'val');
       if(supplierId=='null'||supplierId==null || supplierId=='' ){
               parent.layer.msg('请选择提货方！',{icon: 0,time:1500,shade: [0.8, '#393D49']});
               return;
       }
       $("#supplierName").val(supplierId);

       //数据提交
       $.post('/sea/physical/unusual/save.do',$('#info-form').serialize(),function(data){
           if( data.ok ){
               parent.layer.msg(data.msg,{icon:1,time:1500,shade: [0.8, '#393D49']}, function(){
                   parent.$wareTable.bootstrapTable('refresh');
                   parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭弹窗
               });
           }else{
               parent.layer.msg(data.msg,{icon: 0,time:1500,shade: [0.8, '#393D49']});
           }
       });
   });
   //返回
   $('.return-btn').on('click',function(){
       parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭弹窗
   });

</script>
</body>
</html>